<?php /* Smarty version 2.6.18, created on 2016-12-19 12:46:31
         compiled from article/index.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'truncate', 'article/index.tpl', 59, false),array('modifier', 'date_format', 'article/index.tpl', 61, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "public/header.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div id="page-wrapper">
	<div class="row">
        <div class="col-md-6">
            <a href="<?php echo $this->_tpl_vars['app']; ?>
/article/add" class="btn btn-success">添加文章</a>
        </div>
        <div class="col-md-6">
           
                <div class="form-group input-group">
                    <input type="text" class="form-control" name="key" placeholder="输入链接标题或者地址关键词搜索">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                    </span>
                </div>
        
        </div>
    </div>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "public/title.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    <form  method="post" action="<?php echo $this->_tpl_vars['url']; ?>
/fpro/page/<?php echo $this->_tpl_vars['page']; ?>
<?php if ($_GET['pid']): ?>/pid/<?php echo $_GET['pid']; ?>
<?php endif; ?><?php if ($_GET['search']): ?>/search/<?php echo $_GET['search']; ?>
<?php endif; ?><?php if ($_GET['audit']): ?>/audit/<?php echo $_GET['audit']; ?>
<?php endif; ?>">

    <li class="list-group-item">
			请按分类选择文档&nbsp;&nbsp; <?php echo $this->_tpl_vars['select']; ?>
	
			&nbsp;&nbsp; 
			<input id="sea" type="text" value="<?php echo $this->_tpl_vars['search']; ?>
"> 
			<button  onclick="search()" class="btn btn-primary">搜&nbsp;&nbsp;索</button>
			<script>
				var sel=document.getElementById("sel");
				
				sel.onchange=function(){
					var pid=this.options[this.selectedIndex].value;
					window.location="<?php echo $this->_tpl_vars['url']; ?>
/index/pid/"+pid;
				}

				function search(){
					var pid=sel.options[sel.selectedIndex].value;
					var sval=document.getElementById("sea").value;	
					window.location="<?php echo $this->_tpl_vars['url']; ?>
/index/pid/"+pid+"/search/"+sval;

				}
			</script>
	</li>	
	
	<table class="table table-hover table-striped">
    <thead>
        <tr>
            <th>标题</th>
            <th>作者</th>
            <th>添加时间</th>
            <th>评论</th>
            <th>审核</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
  		<?php unset($this->_sections['doc']);
$this->_sections['doc']['name'] = 'doc';
$this->_sections['doc']['loop'] = is_array($_loop=$this->_tpl_vars['arts']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['doc']['show'] = true;
$this->_sections['doc']['max'] = $this->_sections['doc']['loop'];
$this->_sections['doc']['step'] = 1;
$this->_sections['doc']['start'] = $this->_sections['doc']['step'] > 0 ? 0 : $this->_sections['doc']['loop']-1;
if ($this->_sections['doc']['show']) {
    $this->_sections['doc']['total'] = $this->_sections['doc']['loop'];
    if ($this->_sections['doc']['total'] == 0)
        $this->_sections['doc']['show'] = false;
} else
    $this->_sections['doc']['total'] = 0;
if ($this->_sections['doc']['show']):

            for ($this->_sections['doc']['index'] = $this->_sections['doc']['start'], $this->_sections['doc']['iteration'] = 1;
                 $this->_sections['doc']['iteration'] <= $this->_sections['doc']['total'];
                 $this->_sections['doc']['index'] += $this->_sections['doc']['step'], $this->_sections['doc']['iteration']++):
$this->_sections['doc']['rownum'] = $this->_sections['doc']['iteration'];
$this->_sections['doc']['index_prev'] = $this->_sections['doc']['index'] - $this->_sections['doc']['step'];
$this->_sections['doc']['index_next'] = $this->_sections['doc']['index'] + $this->_sections['doc']['step'];
$this->_sections['doc']['first']      = ($this->_sections['doc']['iteration'] == 1);
$this->_sections['doc']['last']       = ($this->_sections['doc']['iteration'] == $this->_sections['doc']['total']);
?>
        <tr>
            <td><input type="checkbox" name="id[]" value="<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
">
            <a href="<?php echo $this->_tpl_vars['root']; ?>
/index.php/article/details/aid/<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
" target="_blank">
			<?php echo ((is_array($_tmp=$this->_tpl_vars['arts'][$this->_sections['doc']['index']]['title'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 50) : smarty_modifier_truncate($_tmp, 50)); ?>
</a></td>
            <td><?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['author']; ?>
</td>
            <td><?php echo ((is_array($_tmp=$this->_tpl_vars['arts'][$this->_sections['doc']['index']]['posttime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</td>
            <td>
            	<?php if ($this->_tpl_vars['arts'][$this->_sections['doc']['index']]['allow'] == 1): ?>
					<span onclick="set(this,'allow',<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
 )" style="color:#FE488B;cursor:pointer;">√</span>
				<?php else: ?>
					<span onclick="set(this,'allow',<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
)" style="color:#0000F6;cursor:pointer;">×</span>
				<?php endif; ?>
			</td>
            <td>
           	    <?php if ($this->_tpl_vars['arts'][$this->_sections['doc']['index']]['audit'] == 1): ?>
					<span onclick="set(this,'audit',<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
)" style="color:#FE488B;cursor:pointer;">√</span>
				<?php else: ?>
					<span onclick="set(this,'audit',<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
)" style="color:#0000F6;cursor:pointer;">×</span>
				<?php endif; ?>
			</td>
			<td>
			【<a href="<?php echo $this->_tpl_vars['url']; ?>
/mod/id/<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
">修改</a>】
			【<a onclick="return confirm('确定要删除文章<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['title']; ?>
吗？')" href="<?php echo $this->_tpl_vars['url']; ?>
/del/id/<?php echo $this->_tpl_vars['arts'][$this->_sections['doc']['index']]['id']; ?>
/page/<?php echo $this->_tpl_vars['page']; ?>
<?php if ($_GET['pid']): ?>/pid/<?php echo $_GET['pid']; ?>
<?php endif; ?><?php if ($_GET['search']): ?>/search/<?php echo $_GET['search']; ?>
<?php endif; ?><?php if ($_GET['audit']): ?>/audit/<?php echo $_GET['audit']; ?>
<?php endif; ?>">删除</a>】</td>
        </tr>
        <?php endfor; else: ?>
			本页没有文章
	    <?php endif; ?>
  
    </tbody>
    </table>
	<script>
		function set(obj, stat, id){
		var ajax=Ajax();

		if(obj.innerHTML=="√"){
			ajax.get("<?php echo $this->_tpl_vars['url']; ?>
/status/s/"+stat+"/id/"+id+"/val/0", function(data){
				if(data=="1"){
					ieff(obj, "×");
					obj.style.color="#0000F6";
				}
			
			});
				
		}else{
			ajax.get("<?php echo $this->_tpl_vars['url']; ?>
/status/s/"+stat+"/id/"+id+"/val/1", function(data){
				if(data=="1"){
					ieff(obj, "√");
					obj.style.color="#FE488B";
				}
				
			});

		}
				
		}
	</script>				
	
	<li class="list-group-item">
		<div class="row" style="width:100%;margin-top:10px;" > 
			<a href="javascript:select()">&nbsp;全选</a>/<a href="javascript:fanselect()">反选</a>/<a href="javascript:noselect()">全不选</a>&nbsp;&nbsp;选中项: 
			<input  name="allows" type="image" title="充许评论"  src="<?php echo $this->_tpl_vars['res']; ?>
/images/pl1.gif">&nbsp;&nbsp;
			<input  name="nallows" type="image" title="不能评论"  src="<?php echo $this->_tpl_vars['res']; ?>
/images/pl2.gif">&nbsp;&nbsp;
		
			<input  name="audits" type="image" title="审核"  src="<?php echo $this->_tpl_vars['res']; ?>
/images/audit.gif">&nbsp;&nbsp;
			<input  name="locks" type="image" title="锁定"  src="<?php echo $this->_tpl_vars['res']; ?>
/images/lock.gif">&nbsp;&nbsp;
		
			<input  name="dels" type="image" title="删除" onClick="return confirm('你确定要删除选中的文章项吗?')"  src="<?php echo $this->_tpl_vars['res']; ?>
/images/delete.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

			<a style='<?php if ($_GET['audit'] == 'on'): ?>background:#888;color:white<?php endif; ?>' href="<?php echo $this->_tpl_vars['url']; ?>
/index/audit/on">审核过的</a>&nbsp;|
			<a style='<?php if ($_GET['audit'] == 'off'): ?>background:#888;color:white<?php endif; ?>' href="<?php echo $this->_tpl_vars['url']; ?>
/index/audit/off">末审核的</a>
			<span  style="float:right;">
				<?php echo $this->_tpl_vars['fpage']; ?>

			</span>		
		 </div> 
			    
	</li>
   </form>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "public/footer.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>	

